// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CreditsInfo.cs" company="Open Trader">
//   Copyright (c) David Denis (david.denis@systemathics.com)
// </copyright>
// <summary>
//   |  Open Trader - The Open Source Systematic Trading Platform
//   |
//   |  This program is free software: you can redistribute it and/or modify
//   |  it under the terms of the GNU General Public License as published by
//   |  the Free Software Foundation, either version 2 of the License, or
//   |  (at your option) any later version.
//   |
//   |  This program is distributed in the hope that it will be useful,
//   |  but WITHOUT ANY WARRANTY; without even the implied warranty of
//   |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   |  GNU General Public License for more details.
//   |
//   |  You should have received a copy of the GNU General Public License
//   |  along with this program.  If not, see http://www.gnu.org/licenses
//   |
//   |  Up to date informations about Open Trader can be found at :
//   |    http://opentrader.org
//   |    http://opentrader.codeplex.com
//   |
//   |  For professional services, please visit us at :
//   |    http://www.systemathics.com
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Org.OpenTrader.Framework
{
    #region Using Directives

    using System;

    using Org.OpenTrader.Framework.Interfaces;

    #endregion

    /// <summary>
    /// The credits info.
    /// </summary>
    [Serializable]
    public class CreditsInfo : ICreditsInfo
    {
        #region Constants and Fields

        /// <summary>
        /// The author.
        /// </summary>
        private readonly string author;

        /// <summary>
        /// The copyright.
        /// </summary>
        private readonly string copyright;

        /// <summary>
        /// The description.
        /// </summary>
        private readonly string description;

        /// <summary>
        /// The name.
        /// </summary>
        private readonly string name;

        #endregion

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CreditsInfo"/> class.
        /// </summary>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <param name="description">
        /// The description.
        /// </param>
        /// <param name="author">
        /// The author.
        /// </param>
        /// <param name="copyright">
        /// The copyright.
        /// </param>
        public CreditsInfo(string name, string description, string author, string copyright)
        {
            this.name = name;
            this.description = description;
            this.author = author;
            this.copyright = copyright;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets Author.
        /// </summary>
        public string Author
        {
            get
            {
                return this.author;
            }
        }

        /// <summary>
        /// Gets Copyright.
        /// </summary>
        public string Copyright
        {
            get
            {
                return this.copyright;
            }
        }

        /// <summary>
        /// Gets Description.
        /// </summary>
        public string Description
        {
            get
            {
                return this.description;
            }
        }

        /// <summary>
        /// Gets Name.
        /// </summary>
        public string Name
        {
            get
            {
                return this.name;
            }
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// The to string.
        /// </summary>
        /// <returns>
        /// The to string.
        /// </returns>
        public override string ToString()
        {
            return string.Format("{0}, by {1}\n\n{2}\n\n{3}", this.name, this.author, this.description, this.copyright);
        }

        #endregion
    }
}